import React from "react";
import useCounter from "./hooks/useCounter";
import useDjs from "./hooks/useDjs";

// useDebugValue可用于在 React 开发者工具中显示自定义 hook 的标签
// useDebugValue必须和自定义hooks配置使用
const App = () => {
  const [count, add, minus] = useCounter(5);
  const sec = useDjs();

  return (
    <>
      <h2>useDebugValue</h2>
      <button onClick={minus}>-</button>
      <span>{count}</span>
      <button onClick={add}>+</button>

      <p>倒计时：{sec}秒</p>
    </>
  );
};

export default App;
